class PqUi extends egret.Sprite{
    protected inited:boolean=false;
    constructor(){
        super();
        this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this);
        this.addEventListener(egret.Event.REMOVED_FROM_STAGE,this.removeFromStage,this);
    }
    protected init(){
        if(this.inited)return;
        this.inited=true;
    }
    protected onAddToStage(e:egret.Event){
        if(!this.inited)this.init();
    }
    protected removeFromStage(e:egret.Event){
        this.destory();
    }
    protected destory(){
        this.inited=false;
    }
}